#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main()
{
    int a[30][30] = { 0 };
    int i = 0;
    int j = 0;
    int n = 0;
    scanf("%d", &n);
    for (i = 0; i < n; i++)
    {
        for (j = 0; j <= i; j++)
        {
            if (j == 0 || j == i)
            {
                a[i][j] = 1;
            }
            else
            {
                a[i][j] = a[i - 1][j - 1] + a[i - 1][j];
            }
            printf("%5d", a[i][j]);
        }
        printf("\n");
    }
    return 0;
}